import Vue from "vue";
import vueRouter from "vue-router";
Vue.use(vueRouter);
const routes = [
  {
    name: "toIndex",
    path: "/",
    redirect: "/index",
    component: () => import("@/page/first-page/first-index.vue"),
  },
  {
    name: "demoIndex",
    path: "/index",
    component: () => import("@/page/first-page/first-index.vue"),
    children: [
      {
        name: "test-my-event-bus",
        path: "event-bus",
        component: () => import("@/page/test-my-event-bus/first-page.vue"),
      },
      {
        name: "test-virtual-list",
        path: "virtual-list",
        component: () => import("@/page/virtual-list/v-page.vue"),
      },
      {
        name: "test-scrollbar",
        path: "scrollbar",
        component: () => import("@/page/test-scrollbar/scroll-bar.vue"),
      },
    ],
  },
  {
    name:'low-code',
    path:'/low-code',
    component:() => import('@/page/low-code/low-code.vue')
  }
];
const router = new vueRouter({
  mode: "hash",
  routes,
});
router.beforeEach((to, from, next) => {
  console.log(from.fullpath + " -> " + to.fullpath);
  next();
});
export default router;
